#!/bin/bash

# Docker镜像构建脚本

# 设置变量
IMAGE_NAME="ythyw-app"
IMAGE_TAG="latest"

echo "开始构建Docker镜像..."

# 构建Docker镜像
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} .

if [ $? -eq 0 ]; then
    echo "Docker镜像构建成功!"
    echo "镜像名称: ${IMAGE_NAME}:${IMAGE_TAG}"
else
    echo "Docker镜像构建失败!"
    exit 1
fi

echo "运行以下命令启动容器:"
echo "docker run -p 5000:5000 --name ythyw-container ${IMAGE_NAME}:${IMAGE_TAG}"